from django.contrib import admin
from api.models import Email
from app01.templatetags.my_filter import translate_time


# Register your models here.

class EmailAdmin(admin.ModelAdmin):
    def get_create_date(self):
        create_date = translate_time(self.create_date)
        return create_date

    get_create_date.short_description = '发送时间'

    list_display = ['email', 'content', get_create_date]


admin.site.register(Email, EmailAdmin)
